# Maintainer: Nicolas Frattaroli <ovdev@fratti.ch>

_realname=pngcrush
MINGW_PACKAGE_PREFIX="mingw-w64-${CARCH}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.7.73
pkgrel=1
pkgdesc="A tool for optimizing the compression of PNG files"
arch=('any')
url="http://pmt.sourceforge.net/pngcrush"
license=('custom')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-libpng" "${MINGW_PACKAGE_PREFIX}-zlib")
source=("http://downloads.sourceforge.net/pmt/$_realname-$pkgver-nolib.tar.gz")
md5sums=('47d04857eff20e37f12d7b90cff21910')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}-nolib"
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}-nolib"
  CFLAGS+=" -DPNGCRUSH_COUNT_COLORS" make
}

package() {
  install -Dm755 ${srcdir}/${_realname}-${pkgver}-nolib/${_realname} \
    ${pkgdir}${MINGW_PREFIX}/bin/${_realname}
}

